﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Login.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Authentification</title>  
</head>
<body class="general">
    <form id="formLogin" runat="server">            
        
    <asp:Login ID="Login1" runat="server" Width="499px">
        <LayoutTemplate>
            <fieldset id="custom">
               <center>
                <legend>Se connecter</legend>
                <table>
                    <tr>
                        <td align="right">
                            <asp:Label ID="lbUserName" runat="server" AssociatedControlID="UserName" Text="Identifiant :"/>
                        </td>
                        <td>
                            <asp:TextBox ID="UserName" runat="server" MaxLength="8" Width="131px"/>
                            <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" 
                                    ControlToValidate="UserName" ErrorMessage="Un nom d'utilisateur est requis." 
                                    ToolTip="Un nom d'utilisateur est requis.">*</asp:RequiredFieldValidator>                            
                        </td>
                    </tr>        
                    <tr>
                        <td align="right">
                            <asp:Label ID="lbPassword" runat="server" AssociatedControlID="Password" Text="Mot de passe :"/>
                        </td>
                        <td>
                            <asp:TextBox ID="Password" runat="server" TextMode="Password" Width="131px"/>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                    ControlToValidate="Password" ErrorMessage="Un mot de passe est requis." 
                                    ToolTip="Un mot de passe est requis.">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>   
                    <tr>
                        <td colspan="2">
                            <asp:CheckBox ID="RememberMe" runat="server" Text="Mémoriser le mot de passe." />
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="2" style="color:Red;">
                            <asp:Literal ID="FailureText" runat="server" EnableViewState="False"/>

                            &nbsp;
                            
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                ControlToValidate="UserName" Display="Dynamic"
                                ErrorMessage="L'identifiant doit contenir 8 caractères" 
                                ValidationExpression="^[a-zA-Z0-9]{8}$"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" colspan="2">
                            <asp:Button ID="btConnecter" runat="server" CommandName="Login" Text="Se connecter"/>
                        </td>
                    </tr>  
                </table>          
                </center>
            </fieldset>
        </LayoutTemplate>
    </asp:Login>            
        
    </form>
</body>
</html>
